<template>
    <div class="wrapper">
        <div>
           <baseing :weathertotal="message" v-if="message"></baseing>
        </div>
    </div>
</template>

<script>
    import axios from 'axios'
    import baseing from "./baseing";
    export default {
        name: "information",
        data(){
            return{
                result:[[]],
                totalResult : [],
                typeresult: [],
                dateresult:[],
                weekresult:[],
                highresult:[],
                lowresult:[],
                feng:[],
                shuzu: [],
                message: '',
            }
        },
        components:{
          baseing
        },
        created() {
            axios.get('/101070201',{

            }).then(res => {
                for (var i=0;i<15;i++){
                    this.shuzu[i] = res.data.data.forecast[i];
                    this.typeresult[i] = this.shuzu[i].type;
                    this.dateresult[i] = this.shuzu[i].ymd;
                    this.weekresult[i] = this.shuzu[i].week;
                    this.highresult[i] = this.shuzu[i].high;
                    this.lowresult[i] = this.shuzu[i].low;
                    this.feng[i] = this.shuzu[i].fx + this.shuzu[i].fl;
                }
                for (var mm=0;mm<15;mm++){
                    this.result[mm] = [this.dateresult[mm],this.weekresult[mm],this.typeresult[mm],this.highresult[mm],this.lowresult[mm],this.feng[mm]];
                }
                console.log(this.result)
                this.message = this.result;
            })
        }
    }
</script>

<style scoped lang="scss">
    .wrapper{
        width: 15rem;
        height: 5.8rem;
    }
</style>
